<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNoticeStepTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('info_notice_programs', function (Blueprint $table) {
            // 表结构
            $table->increments('id')->comment('自增ID');
            $table->string('code')->unique()->comment('栏目代码');
            $table->string('name')->comment('栏目名称');
            $table->softDeletes();
            $table->timestamps();

        });

        Schema::create('info_notices', function (Blueprint $table) {
            // 表结构
            $table->bigIncrements('id')->comment('自增ID');
            $table->string('code')->unique()->comment('公告代码');
            $table->string('title')->comment('标题');
            $table->string('program_code')->comment('所属栏目代码');
            $table->string('publisher_code')->comment('发布者代码');
            $table->smallInteger('type')->default(0)->comment('新闻类型：0：图文；2：视频');
            $table->json('content')->comment('公告内容');
            $table->string('videoCoverPic')->nullable()->comment('视频封面图片');
            $table->boolean('isShow')->default(false)->comment('移动端是否显示');
            $table->softDeletes();
            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('info_notice_programs');
        Schema::dropIfExists('info_notices');
    }
}
